package com.lx.javasunmmrize.factory.abstractFactory.order;

import com.lx.javasunmmrize.factory.abstractFactory.pizza.BJFruitsPizza;
import com.lx.javasunmmrize.factory.abstractFactory.pizza.BJPepperPizza;
import com.lx.javasunmmrize.factory.abstractFactory.pizza.Pizza;

/**
 * @Description TODO
 * @Author lx
 * @Date 2021/2/28 18:33
 **/
public class BJSimpleFactory implements SimpleFactory {
    @Override
    public Pizza createPizza(String orderType) {
        System.out.println("~使用的是抽象工厂模式~");
        // TODO Auto-generated method stub
        Pizza pizza = null;
        if(orderType.equals("fruits")) {
            pizza = new BJFruitsPizza();
        } else if (orderType.equals("pepper")){
            pizza = new BJPepperPizza();
        }
        return pizza;
    }
}
